package com.dq.health.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dq.health.entity.notify.SysNotify;
import com.dq.health.service.IAPINotifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.dq.health.dto.request.notify.QueryNotifyParam;
import com.dq.health.utils.view.SimpleView;

/**
 * <系统通知>
 *
 * @Author: chenxin
 * @Date: 2021/5/22
 */
@RestController
@RequestMapping("/notify")
public class SysNotifyController {

    @Autowired
    private IAPINotifyService notifyService;

    @PostMapping("/queryList")
    public SimpleView<IPage<SysNotify>> queryList(@RequestBody QueryNotifyParam request) {
        SimpleView<IPage<SysNotify>> view = new SimpleView<>();

        IPage<SysNotify> sysNotifyIPage = notifyService.listNotify(request);

        view.success(sysNotifyIPage);
        return view;
    }

}
